package com.authine.cloudpivot.web.api.secondopen.service.impl;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.authine.cloudpivot.web.api.secondopen.dao.BudgetLogMapper;
import com.authine.cloudpivot.web.api.secondopen.dao.MonthlybudgetadjustrecordMapper;
import com.authine.cloudpivot.web.api.secondopen.dao.QnyssqMapper;
import com.authine.cloudpivot.web.api.secondopen.domain.BudgetLog;
import com.authine.cloudpivot.web.api.secondopen.domain.Iusi6BmsqsB;
import com.authine.cloudpivot.web.api.secondopen.domain.Monthlybudgetadjustrecord;
import com.authine.cloudpivot.web.api.secondopen.domain.Qnyssq;
import com.authine.cloudpivot.web.api.secondopen.service.BudgetMaintainService;
import com.authine.cloudpivot.web.api.secondopen.service.SyncService;
import io.jsonwebtoken.lang.Collections;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;


@Service
public class BudgetMaintainServiceImpl implements BudgetMaintainService {
    private static final Logger log = LoggerFactory.getLogger(BudgetMaintainServiceImpl.class);

    @Autowired(required=true)
    private QnyssqMapper qnyssqMapper;

    @Autowired(required=true)
    private MonthlybudgetadjustrecordMapper monthlybudgetadjustrecordMapper;

    @Autowired(required=true)
    private BudgetLogMapper budgetLogMapper;


    @Override
    public List<Qnyssq> checkAnnualBudget(Qnyssq qnyssq) {
        return qnyssqMapper.selectQnyssqListByParam(qnyssq);
    }

    @Override
    public List<Monthlybudgetadjustrecord> getBudgetQuota(Monthlybudgetadjustrecord monthlybudgetadjustrecord) {
        return monthlybudgetadjustrecordMapper.selectBudgetInfoByParam(monthlybudgetadjustrecord);
    }

    @Override
    public int addBudgetAmendment(Monthlybudgetadjustrecord monthlybudgetadjustrecord) {
        return monthlybudgetadjustrecordMapper.zjiaBudgetAmendment(monthlybudgetadjustrecord);
    }

    @Override
    public int addBudgetLog(BudgetLog budgetLog) {
        return budgetLogMapper.insertBudgetLog(budgetLog);
    }

    @Override
    public int jsBudgetAmendment(Monthlybudgetadjustrecord monthlybudgetadjustrecord) {
        return monthlybudgetadjustrecordMapper.zjianBudgetAmendment(monthlybudgetadjustrecord);
    }

    @Override
    public int adjustmentBudgetData(Monthlybudgetadjustrecord monthlybudgetadjustrecord) {
        return monthlybudgetadjustrecordMapper.adjustmentBudgetData(monthlybudgetadjustrecord);
    }

    @Override
    public int ReimburseBudget(Monthlybudgetadjustrecord monthlybudgetadjustrecord) {
        return monthlybudgetadjustrecordMapper.ReimburseBudgetData(monthlybudgetadjustrecord);
    }

}
